export type CatalogueConfig = SideBarItem[];
export type SideBarItem = SideBarLink | SideBarGroup;
export interface SideBarLink {
    text: string;
    link: string;
}
export interface SideBarGroup {
    text: string;

    children: SideBarItem[];
}
export function isSideBarLink(o: any): o is SideBarLink {
    return typeof o?.text === "string" && typeof o?.link === "string";
}
export function isSideBarGroup(o: any): o is SideBarGroup {
    const children = o?.children;
    return (
        typeof o?.text === "string" &&
        Array.isArray(children) &&
        isSideBarItems(children)
    );
}
export function isSideBarItems(o: any): o is SideBarItem[] {
    const children = o;
    return (
        Array.isArray(children) &&
        children.every((v) => isSideBarLink(v) || isSideBarGroup(v))
    );
}
